{capture name=js_urls}
	{$admin_theme_url}/js/jq-bulkactions.js
{/capture}
{include file="file:$admin_theme_global_path/_header.tpl"
	pageTitle="Dealers" masthead="Manage Dealers" current="dealers_admin_index" js_urls=$smarty.capture.js_urls}
<div class="grid_16 inline">
	<!-- <h3>{t}Options{/t}</h3>
	<ul>
		<li><a href="/dealers/admin/edit/id/-1/dealer_type_id/1">New Storefront</a></li>
		<li><a href="/dealers/admin/edit/id/-1/dealer_type_id/2">New Online</a></li>
	</ul> -->
	<div class="top-actions grid_3 alpha inline">
		<form id="bulk_action_form" action="" method="get" class="bulk-actions">
			<select name="bulk_action" id="bulk_action">
				<option value="">{t}Bulk Actions{/t}</option>
				<option value="{url}/dealers/admin/bulkdelete{/url}">{t}Delete{/t}</option>
			</select>
			<input type="submit" value="{t}Apply{/t}" />
		</form>
	</div>
	<div class="top-actions grid_6 omega inline">
		<form action="{url}/dealers/admin/index{/url}" method="get">
			{html_options name=c options=$countries selected=$c}
			{html_options name=dt options=$dealer_types selected=$dt}
			<input type="submit" value="View" />
		</form>
	</div>
	<div class="top-actions grid_7 inline">
		<form action="{url}/dealers/admin/index{/url}" method="get" class="search">
			<input type="text" name="q" id="q" value="{$q}" style="width:190px" />
			<input type="submit" value="{t}Search Dealers{/t}" />
		</form>
	</div>
	{include file="file:$admin_theme_global_path/_pager.tpl" class="grid_16 alpha omega"}
	<div class="grid_12 faux-thead alpha omega">
		<div class="grid_1 alpha"><input type="checkbox" class="checkbox" name="check_all" id="check_all" /></div>
		<div class="grid_1">{t}ID{/t}</div>
		<div class="grid_2">{t}Dealer{/t}</div>
		<div class="grid_3">{t}Country{/t}</div>
		<div class="grid_2">{t}Dealer Type{/t}</div>
		<div class="grid_3 omega">{t}Date Modified{/t}</div>
	</div>
	{foreach from=$dealers item=dealer key=index}
		<div class="grid_12{if ($index + 1) mod 2 eq 0} even{else} odd{/if} faux-tr alpha omega">
			<div class="grid_1 alpha">
				<input type="checkbox" class="bulk_checkbox"
					name="bulk_checkbox[]" id="dealer_checkboxes_{$dealer.id}"
					value="{$dealer.id}" />
			</div>
			<div class="grid_1">{$dealer.code}</div>
			<div class="grid_2">
				<a href="{url}/dealers/admin/edit/id/{$dealer.id}{/url}">{$dealer.name}</a>
			</div>
			<div class="grid_3">
				{if $dealer.dealer_type_id eq "1"}
					{$dealer.country}
				{elseif $dealer.dealer_type_id eq "2"}
					({t}online{/t})
				{/if}
			</div>
			<div class="grid_2">{$dealer.dealer_type_name}</div>
			<div class="grid_3 omega">{$dealer.last_modified_on}</div>
		</div>
	{/foreach}
	{include file="file:$admin_theme_global_path/_pager.tpl" class="grid_12 alpha omega"}
</div>
{include file="file:$admin_theme_global_path/_footer.tpl"}
